Skip to content

Conversation

foldl
Copy link
Contributor

@foldl foldl commented Aug 17, 2025

DWORD is defined as int32, so DWORD(...) would not work as expected. When writing to files larger than 2GB, exception occurs:

unhandled exception: value out of range: 4294967295 notin -2147483648 .. 2147483647 [RangeDefect]

This PR is a quick fix for this.

P.S. Why DWORD is defined as int32?

`DWORD` is defined as `int32`, so this would not work as expected. When writing to files larger than 2GB, exception occurs:

```
unhandled exception: value out of range: 4294967295 notin -2147483648 .. 2147483647 [RangeDefect]
```

This PR is a quick fix for this.

P.S. Why `DWORD` is defined as `int32`?
@ringabout
Copy link
Member

See also #12327

@Araq Araq merged commit 4f09675 into nim-lang:devel Sep 10, 2025
14 of 18 checks passed
Copy link
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 4f09675

Hint: mm: orc; opt: speed; options: -d:release
183028 lines; 9.053s; 659.957MiB peakmem

@foldl foldl deleted the patch-file-offset branch September 10, 2025 14:51
narimiran pushed a commit that referenced this pull request Sep 12, 2025
`DWORD` is defined as `int32`, so `DWORD(...)` would not work as
expected. When writing to files larger than 2GB, exception occurs:

```
unhandled exception: value out of range: 4294967295 notin -2147483648 .. 2147483647 [RangeDefect]
```

This PR is a quick fix for this.

P.S. Why `DWORD` is defined as `int32`?

(cherry picked from commit 4f09675)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants